function groupTest()
{
	// Create a new group
	groupCreate();

	// Invite someone to join the group, rejected
	groupInvite("delete");
	
	// Invite someone to join the group, agreed
	groupInvite("confirm");

	// Delete group
	//groupDelete();

	// Group admin directly addssome one to a group
	groupJoin();
}

function groupCreate()
{
	var item=new Object();
	item.type="groupCreate";
	item.param=new Object();
	item.param.name="testGroup";
	item.param.intro="testGroup intro";
	item.param.image="http://www.readjoy.cn/test.jpg";
	item.param.tag="test";
	item.param.publicFlag="1";
	item.param.memberId="2";
	item.result=new Object();
	item.result.owner=this;
	item.result.onResult=function(res)
	{
		Packages.log("groupCreate.onResult: "+res.returnObj, "debug");
		if (res.returnObj!=null)
		{
		}
	}	
	Packages.services.RemotingCall.rtmpCaller(item);
}

function groupInvite(flag:String)
{
	var item=new Object();
	item.type="groupInvite";
	item.param=new Object();
	item.param.memberIdFrom="3";
	item.param.memberIdTo="1";
	item.param.groupId="1";
	item.result=new Object();
	item.result.owner=this;
	item.result.onResult=function(res)
	{
		Packages.log("groupInvite.onResult: "+res.returnObj, "debug");
		if (res.returnObj!=null)
		{
			if (flag=="confirm")
			{
				groupInviteConfirm(res.returnObj.toString());
			} 
			if (flag=="delete") 
			{
				groupInviteDelete(res.returnObj.toString());
			}
		}
	}	
	Packages.services.RemotingCall.rtmpCaller(item);
}

function groupInviteConfirm(groupConfirmId:String)
{
	var item=new Object();
	item.type="groupInviteConfirm";
	item.param=new Object();
	item.param.groupConfirmId=groupConfirmId;
	item.param.memberIdTo="1";
	item.result=new Object();
	item.result.owner=this;
	item.result.onResult=function(res)
	{
		Packages.log("groupInviteConfirm.onResult: returnCode="+res.returnCode, "debug");
		if (res.returnObj!=null)
		{
		}
	}	
	Packages.services.RemotingCall.rtmpCaller(item);
}

function groupInviteDelete(groupConfirmId:String)
{
	var item=new Object();
	item.type="groupInviteDelete";
	item.param=new Object();
	item.param.groupConfirmId=groupConfirmId;
	item.param.memberIdTo="1";
	item.result=new Object();
	item.result.owner=this;
	item.result.onResult=function(res)
	{
		Packages.log("groupInviteDelete.onResult: returnCode="+res.returnCode, "debug");
		if (res.returnObj!=null)
		{
		}
	}	
	Packages.services.RemotingCall.rtmpCaller(item);
}

function groupJoin()
{
	var item=new Object();
	item.type="groupJoin";
	item.param=new Object();
	item.param.memberId="3";
	item.param.groupId="1";
	item.result=new Object();
	item.result.owner=this;
	item.result.onResult=function(res)
	{
		Packages.log("groupJoin.onResult: "+res.returnObj, "debug");
		if (res.returnObj!=null)
		{
		}
	}	
	Packages.services.RemotingCall.rtmpCaller(item);
}

function groupTopicCreate()
{
	var item=new Object();
	item.type="groupTopicCreate";
	item.param=new Object();
	item.param.memberId="3";
	item.param.groupId="1";
	item.param.title="test title";
	item.param.body="test body";
	item.result=new Object();
	item.result.owner=this;
	item.result.onResult=function(res)
	{
		Packages.log("groupTopicCreate.onResult: "+res.returnObj, "debug");
		if (res.returnObj!=null)
		{
		}
	}	
	Packages.services.RemotingCall.rtmpCaller(item);
}

function groupTopicDelete()
{
	var item=new Object();
	item.type="groupTopicDelete";
	item.param=new Object();
	item.param.memberId="3";
	item.param.groupTopicId="1";
	item.result=new Object();
	item.result.owner=this;
	item.result.onResult=function(res)
	{
		Packages.log("groupTopicDelete.onResult: "+res.returnObj, "debug");
		if (res.returnObj!=null)
		{
		}
	}	
	Packages.services.RemotingCall.rtmpCaller(item);
}

function groupTopicSticky()
{
	var item=new Object();
	item.type="groupTopicCreate";
	item.param=new Object();
	item.param.memberId="3";
	item.param.groupTopicId="1";
	item.result=new Object();
	item.result.owner=this;
	item.result.onResult=function(res)
	{
		Packages.log("groupTopicSticky.onResult: "+res.returnObj, "debug");
		if (res.returnObj!=null)
		{
		}
	}	
	Packages.services.RemotingCall.rtmpCaller(item);
}

function groupTopicUnsticky()
{
	var item=new Object();
	item.type="groupTopicUnsticky";
	item.param=new Object();
	item.param.memberId="3";
	item.param.groupTopicId="1";
	item.result=new Object();
	item.result.owner=this;
	item.result.onResult=function(res)
	{
		Packages.log("groupTopicUnsticky.onResult: "+res.returnObj, "debug");
		if (res.returnObj!=null)
		{
		}
	}	
	Packages.services.RemotingCall.rtmpCaller(item);
}

function groupTopicCommentCreate()
{
	var item=new Object();
	item.type="groupTopicUnsticky";
	item.param=new Object();
	item.param.memberId="3";
	item.param.groupTopicId="1";
	item.param.comment="test comment";
	item.result=new Object();
	item.result.owner=this;
	item.result.onResult=function(res)
	{
		Packages.log("groupTopicCommentCreate.onResult: "+res.returnObj, "debug");
		if (res.returnObj!=null)
		{
		}
	}	
	Packages.services.RemotingCall.rtmpCaller(item);
}

function groupTopicCommentDelete()
{
	var item=new Object();
	item.type="groupTopicCommentDelete";
	item.param=new Object();
	item.param.memberId="3";
	item.param.groupTopicCommentId="1";
	item.result=new Object();
	item.result.owner=this;
	item.result.onResult=function(res)
	{
		Packages.log("groupTopicCommentDelete.onResult: "+res.returnObj, "debug");
		if (res.returnObj!=null)
		{
		}
	}	
	Packages.services.RemotingCall.rtmpCaller(item);
}

